public class Processor {
    private final int frequency;
    private final int cores;
    private final String vendor;
    private final double weight;

    public Processor(int frequency, int cores, String vendor, double weight) {
        this.frequency = frequency;
        this.cores = cores;
        this.vendor = vendor;
        this.weight = weight;
    }

    public int getFrequency() {
        return frequency;
    }

    public int getCores() {
        return cores;
    }

    public String getVendor() {
        return vendor;
    }

    public double getWeight() {
        return weight;
    }

    public String toString() {
        String string = "Процессор " + getVendor() + " " + getFrequency() + " МГц " + getCores();

        switch (getCores()) {
            case 1:
                string = string + " ядро";
                break;
            case 2:
            case 3:
            case 4:
                string = string + " ядра";
                break;
            default:
                string = string + " ядер";
        }

        return string;
    }
}
